<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">

    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Relation_type')}:</label>
        <div class="col-xs-12 col-sm-8">
                        
            <select  id="c-relation_type" data-rule="required" class="form-control selectpicker" name="row[relation_type]">
                {foreach name="relationTypeList" item="vo"}
                    <option value="{$key}" {in name="key" value="$row.relation_type"}selected{/in}>{$vo}</option>
                {/foreach}
            </select>

        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Flow_items')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <dl class="fieldlist" data-template="eventtpl" data-name="row[flow_items]">
                <dd>
                    <ins style="width:15%">{:__('审批层级')}</ins>
                    <ins style="width:30%">{:__('审批类型')}</ins>
                    <ins style="width:40%">{:__('选择')}</ins>
                </dd>
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
                <textarea name="row[flow_items]" class="form-control hide" cols="30" rows="5">{$row.flow_items|htmlentities}</textarea>
            </dl>
            <script id="eventtpl" type="text/html">
                <dd class="form-inline">
                    <ins style="width:15%">第<%=index+1%>级</ins>
                    <ins style="width:30%"><select name="row[<%=name%>][<%=index%>][stafftype]" class="form-control stafftype" style="width: 100%">
                        <option value="1" <%if (row['stafftype'] == 1){%>selected="selected"<%}%> >指定用户（任意一人）</option>
                        <option value="2" <%if (row['stafftype'] == 2){%>selected="selected"<%}%> >指定用户（多人会签）</option>
                        <!-- <option value="3" <%if (row['stafftype'] == 3){%>selected="selected"<%}%> >直属上级</option> -->
            
                    </select></ins>
                    <ins style="width:40%">
                        <div <%if (row['stafftype'] == 3){%>style="display: none"<%}%>>
                            <input type="text" placeholder="请选择用户" class="form-control selectpage disabled" name="row[<%=name%>][<%=index%>][admin_id]" data-pagination="true" data-page-size="10" data-multiple="true"
                            style="width: 100%;" data-source="auth/admin/index" data-field="nickname" data-search-field="nickname,username,mobile" data-primary-key="id" value="<%=row['admin_id']%>" >
                        </div>
                        
                    </ins>
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                </dd>   
            </script> 


        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Remark')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-remark" data-rule="required" class="form-control" name="row[remark]" type="text" value="{$row.remark|htmlentities}">
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            
            <input  id="c-status" name="row[status]" type="hidden" value="{$row.status}">
            <a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-status" data-yes="1" data-no="0" >
                <i class="fa fa-toggle-on text-success {eq name="$row.status" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
            </a>
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-primary btn-embossed disabled">{:__('OK')}</button>
        </div>
    </div>
</form>
